<template>
    <view>
        <!-- 遮罩层 -->
        <view class="popup-mask" v-if="visible"></view>

        <!-- 弹窗内容 -->
        <view class="popup-container" v-if="visible">
            <view class="popup-content">
                <view class="popup-header">
                    <text class="popup-title">请选择认证类型</text>
                </view>

                <view class="popup-body">
                    <view class="popup-item auth-bg1" @click="handleSelect('non_operational')">
                        <text>非营运车主</text>
                    </view>
                    <view class="popup-item auth-bg2" @click="handleSelect('operational')">
                        <text>营运车主</text>
                    </view>
                </view>

                <view class="popup-footer">
                   <image src="/static/personalCenter/auth-close.png" mode="aspectFill" @click="close"></image>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    props: {
        visible: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            options: [
                { label: '非营运车主', value: 'non_operational' },
                { label: '营运车主', value: 'operational' },
            ]
        }
    },
    methods: {
        close() {
            this.$emit('update:visible', false)
        },
        handleSelect(item) {
            this.$emit('select', item)
            this.close()
        }
    }
}
</script>

<style scoped>
.popup-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.popup-container {
    position: fixed;
    top: 30%;
    left: 0;
    right: 0;
    z-index: 999;
    transition: all 0.3s ease;
    margin: 0 76rpx;
}

.popup-content {
    background-color: #fff;
    border-radius: 40rpx;
    padding: 54rpx 40rpx 60rpx 40rpx;
}

.popup-header {
    text-align: center;
    margin-bottom: 58rpx;

}

.popup-header .popup-title {
    font-family: Source Han Sans CN, Source Han Sans CN;
    font-weight: 500;
    font-size: 32rpx;
    color: #0B1F20;
    line-height: 48rpx;
}

.popup-body .popup-item {
    width: 100%;
    height: 160rpx;
    background-size: 100% 100%;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.auth-bg1 {
    background-image: url("~@/static/personalCenter/auth-bg1.png");
    margin-bottom: 60rpx;
}

.auth-bg2 {
    background-image: url("~@/static/personalCenter/auth-bg2.png");
}

.popup-item:last-child {
    border-bottom: none;
}

.popup-item text {
    font-family: Source Han Sans CN, Source Han Sans CN;
    font-weight: 700;
    font-size: 34rpx;
    color: #FFFFFF;
    line-height: 48rpx;
    padding-left: 40rpx;
}

.popup-footer {
   position: absolute;
   bottom: -80rpx;
   left: 276rpx;
}
.popup-footer image{
    width: 48rpx;
    height: 48rpx;
}

</style>